package cn.wolfcode.wolf2w.repository;

import cn.wolfcode.wolf2w.domain.Destination;
import cn.wolfcode.wolf2w.domain.Region;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.ArrayList;
import java.util.List;

/**
 * MongoDB持久层
 *
 */
public interface DestinationRepository extends MongoRepository<Destination,String> {

    List<Destination> findAllByIdIn(List<String> ids);

    List<Destination> findByDeep(int deep);

    List<Destination> findByParentName(String regionId);

    List<Destination> findByParentIdIn(List<String> refIds);

    //查询id匹配的城市
    List<Destination> findByIdIn(List<String> id);

    //根据父亲id查询子级目的地
    List<Destination> findByParentId(String id);
}
